import { createRouter, createWebHistory } from 'vue-router'
import HomeView from '../views/HomeView.vue'
import layout from '@/views/layout/indexView.vue'
import  Login from '@/views/login/indexView.vue'
import  Home from  '@/views/Home/indexView.vue'
import Category from '@/views/Category/indexView.vue'
const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes: [
    {
      path:'/',
      component: layout,
      children:[
        {
          //home默认在首页显示所以path为空
          path: '',
          component: Home
        },
        {
          path:'category',
          component:Category
        }
      ]

    },
    {
      path:'/login',
      component: Login
    },

  ],
})

export default router
